package cc5_RMI;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
//import java.util.Scanner;

import RMI.IGestionRemota;
import cc5_BEAN_negocio.Rodamiento;

public class ObtenerServicios {
	
	private float resultado;
	private Rodamiento roda;
	
	public void getStub(){
		
		roda = new Rodamiento();
		try {
			IGestionRemota i = (IGestionRemota) Naming.lookup("//localhost/Gestion");
			resultado = i.obtenerMejorPrecio(roda);
			System.out.println(resultado);
		} catch (MalformedURLException e){ //| RemoteException | NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
				
	}
	
	public static void main (String []args){
		ObtenerServicios s = new ObtenerServicios();
		s.getStub();
	}
}
